import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import LoginView from '../views/LoginView.vue'
import RegisterView from '../views/RegisterView.vue'
import CategoriesView from '../views/CategoriesView.vue'
import ProductDetailView from '../views/ProductDetailView.vue'
import CartView from '../views/CartView.vue'
import UserCenterView from '../views/UserCenterView.vue'
import CheckoutView from '../views/CheckoutView.vue'
import OrderDetailView from '../views/OrderDetailView.vue'
import FavoritesView from '../views/FavoritesView.vue'
import ReviewView from '../views/ReviewView.vue'
import AddressView from '../views/AddressView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView
    },
    {
      path: '/login',
      name: 'login',
      component: LoginView
    },
    {
      path: '/register',
      name: 'register',
      component: RegisterView
    },
    {
      path: '/categories',
      name: 'categories',
      component: CategoriesView
    },
    {
      path: '/product-detail',
      name: 'product-detail',
      component: ProductDetailView
    },
    {
      path: '/cart',
      name: 'cart',
      component: CartView
    },
    {
      path: '/user-center',
      name: 'user-center',
      component: UserCenterView
    },
    {
      path: '/checkout',
      name: 'checkout',
      component: CheckoutView
    },
    {
      path: '/order-detail',
      name: 'order-detail',
      component: OrderDetailView
    },
    {
      path: '/favorites',
      name: 'favorites',
      component: FavoritesView
    },
    {
      path: '/review',
      name: 'review',
      component: ReviewView
    },
    {
      path: '/address',
      name: 'address',
      component: AddressView
    }
  ]
})

export default router
